/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package swing;

import java.awt.Image;
import java.awt.Toolkit;

/**
 *
 * @author Dark
 */
public class RuleOfGame extends java.awt.Dialog {

    /**
     * Creates new form RuleOfGame
     */
     Image icon = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/images/question_mark_icon_blueglow.png"));
    String rule1 = "<br><center><H2>Rule of game</h2><br>"
            + "<b>While playing the game the user will have three life lines to save<br>"
            + "them which can be used only once for the particular user <br><br><br></center>"
            + "<font color=" + "red" + "><b>50:50:</font></b><font color=" + "blue" + ">"
            + "Out of the four options the two wrong answers will "
            + "get erased, which makes only two options available for the user...<br><br></font>"
            + "<font color=" + "red" + "><b>Flip:</b></font><font color=" + "blue" + ">"
            + " If the user feels you can’t answer the question"
            + "then they can flip the question and other question should generate automatically.<br></font>"
            + "<br><font color=" + "red" + "><b>Double dip:</b></font> <font color=" + "blue" + ">"
            + "Here user gets two attempt to answer the question but are not allowed "
            + "leaving the game if the first attempt goes wrong</font>"
            + "<br><br><br><br><br><br><br><br>"
            + "Copyright © KBC QUIZ GAME";

    public RuleOfGame(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setIconImage(icon);
        this.setLocationRelativeTo(null);
        txtRule.setContentType("text/html");
        txtRule.setText(rule1);

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        txtRule = new javax.swing.JTextPane();
        jPanel1 = new javax.swing.JPanel();
        btnOk = new javax.swing.JButton();

        setAlwaysOnTop(true);
        setMinimumSize(new java.awt.Dimension(634, 501));
        setResizable(false);
        setTitle("Rules Of Game");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        txtRule.setEditable(false);
        jScrollPane2.setViewportView(txtRule);

        btnOk.setText("OK");
        btnOk.setMaximumSize(new java.awt.Dimension(47, 50));
        btnOk.setMinimumSize(new java.awt.Dimension(47, 50));
        btnOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnOkActionPerformed(evt);
            }
        });
        jPanel1.add(btnOk);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 634, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 634, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 468, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
         dispose();
    }//GEN-LAST:event_closeDialog

    private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOkActionPerformed
         new PlayGame().setVisible(true);     
        this.dispose();
    }//GEN-LAST:event_btnOkActionPerformed
    /**
     * @param args the command line arguments
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnOk;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextPane txtRule;
    // End of variables declaration//GEN-END:variables
    //</editor-fold>

    /*
     * Create and display the form
     */
}
